/*
 * @Autor: dingxiaolin
 * @Date: 2020-12-24 20:51:42
 * @LastEditors: dingxiaolin
 * @LastEditTime: 2020-12-25 02:29:57
 */
const globalModules = {
  namespaced:true,
  state: {
    isSdkReady: false,
    sex: "女",
  },
  getters: {
    isSdkReady: state => state.isSdkReady,
  },
  mutations: {
    showToast (state, payload) {
      wx.showToast({
        title: payload.title,
        icon: payload.icon || 'none',
        duration: payload.duration || 800
      })
    },
    setSdkReady (state, payload) {
      state.isSdkReady = payload
    },
    setSex (state, payload) {
        console.log('gggggggg',state,payload)
      state.sex = payload
    },
  },
  actions: {
    resetStore ({ dispatch, commit, getters, rootGetters }) {
      commit('user/resetUser') //其他模块的action
    }
  }
}

export default globalModules
